#include <cstdio>
#include <algorithm>

#define V 30001 
#define N 101

using namespace std; 

int v[N]; 	//price
int n, m; 

int a[V]; 	// index is price, 
				// value is maximum product that can be bought in 

int main()
{
	int h, i, j, k, p, t, s; 
	int res=0; 
	
	//freopen("p1164.in", "r", stdin); 

	scanf("%d %d", &n, &m); 
	for (i=0; i<n; i++) { 
		scanf("%d", &v[i]); 
	} 

	a[0] = 1; 
	for (i=0; i<n; i++) {
		for (j=m; j>=v[i]; j--) { 
			a[j] = a[j] + a[j-v[i]]; 
		}
	}
	/*
	for (i=0; i<=m; i++) {
		printf("%d: %d\n", i, a[i]); 
	}*/
	printf("%d\n", a[m]); 
	return 0; 
}


